#ifndef PK_LOGGER
#define PK_LOGGER

#include <sstream>
#include <iostream>
#include <fstream>

#define logERROR 0
#define logWARNING 1
#define logINFO 2
#define logDEBUG 3
#define logDEBUG1 4
#define logDEBUG2 5
#define logDEBUG3 6
#define logDEBUG4 7

#define NUM_LOG_LEVELS 8

#define LOG(level) \
if (level > Logger::ReportingLevel()) ; \
else Logger().Get(level)


class Logger
{
public:
   Logger();
   virtual ~Logger();
   std::ostringstream& Get(int level = logINFO);
   static int& ReportingLevel();
   static void init(int repLevel, std::string filename);
   static void shutdown();
protected:
   std::ostringstream os;
   int messageLevel;
   static std::ofstream* ofs;
   static int reportingLevel;
   static std::string* levelNames;
};

#endif
